package com.atguigu.yygh.user.service;

import com.atguigu.yygh.model.user.UserInfo;
import com.atguigu.yygh.vo.user.LoginVo;
import com.atguigu.yygh.vo.user.UserAuthVo;
import com.atguigu.yygh.vo.user.UserInfoQueryVo;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.google.gson.Gson;

import java.util.Map;

/**
 * <p>
 * 用户表 服务类
 * </p>
 *
 * @author atguigu
 * @since 2022-12-27
 */
public interface UserInfoService extends IService<UserInfo> {

    /**
     * 实现用户登录
     * 手机验证码登录
     *
     * @param loginVo
     * @return
     */
    Map<String, Object> login(LoginVo loginVo);

    UserInfo selectWxInfoByOpenId(String openid);

    UserInfo getUserInfo(Gson gson, String openid, String accessToken) throws Exception;

    /**
     * 提交用户认证信息
     *
     * @param userId     用户id
     * @param userAuthVo 前端的用户VO对象
     */
    void userAuth(Long userId, UserAuthVo userAuthVo);

    /**
     * 获取用户认证信息
     *
     * @param userId
     * @return
     */
    UserInfo getUserInfoById(Long userId);

    IPage<UserInfo> selectPage(Page<UserInfo> pageParam, UserInfoQueryVo userInfoQueryVo);

    boolean lock(Long userId, Integer status);

    Map<String, Object> show(Long userId);

    boolean approval(Long userId, Integer authStatus);
}
